﻿using System;
using System.Collections.Generic;
using System.Text;
using Volo.Abp.Domain.Entities.Auditing;

namespace Coway.Ordering.Orders
{
    public class InstallationInfo : FullAuditedEntity<Guid>
    {
        /// <summary>
        /// 名字
        /// </summary>
        public string FirstName { get; set; }

        /// <summary>
        /// 姓氏
        /// </summary>
        public string LastName { get; set; }

        /// <summary>
        /// 安装申请日期
        /// </summary>
        public DateTime? RequestDate { get; set; }

        /// <summary>
        /// 安装地址 - 街道
        /// </summary>
        public string AddressStreet { get; set; }

        /// <summary>
        /// 安装地址 - 城市
        /// </summary>
        public string AddressCity { get; set; }

        /// <summary>
        /// 安装地址 - 州
        /// </summary>
        public string AddressState { get; set; }

        /// <summary>
        /// 安装地址 - 公寓住宅bai (单元住宅, 房间du)
        /// </summary>
        public string AddressApt { get; set; }

        /// <summary>
        /// 安装地址 - 邮编
        /// </summary>
        public string AddressZipCode { get; set; }

        /// <summary>
        /// 家庭电话
        /// </summary>
        public string HomePhone { get; set; }

        /// <summary>
        /// 家庭电话
        /// </summary>
        public string HomePhoneFormat()
        {
            return InnerPhoneFormat(this.HomePhone);
        }

        private string InnerPhoneFormat(string phone)
        {
            if (!string.IsNullOrWhiteSpace(phone) && phone.Length > 6)
            {
                return phone.Insert(0, "(").Insert(4, ")").Insert(8, "-");
            }
            else
            {
                return phone;
            }
        }
        /// <summary>
        /// 手机号码
        /// </summary>
        public string Mobile { get; set; }

        /// <summary>
        /// 手机号码
        /// </summary>
        public string MobileFormat()
        {
            return InnerPhoneFormat(this.Mobile);
        }

        /// <summary>
        /// 选项
        /// </summary>
        public string Option { get; set; }

        /// <summary>
        /// 会员（选择	□YES□NO）
        /// </summary>
        public string Membership { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remarks { get; set; }
    }
}
